import request from '@/utils/request'
// 获取文章的接口
export function fetchList(query) { // 获取列表
// query  {__ob__: Observer},limit: 5,page: 1,sort: "+id",type: "CN"
  return request({
    url: '/vue-element-admin/article/list',
    method: 'get',
    params: query
  })
}

export function fetchArticle(id) { // 获取文章
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) { // 根据pv查找
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createArticle(data) { // 创建文章
  return request({
    url: '/vue-element-admin/article/create',
    method: 'post',
    data
  })
}

export function updateArticle(data) { // 更新文章
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}
